package io.github.mengflyl.excel.report.viewer;

import io.github.mengfly.excel.report.template.DataContext;

@SuppressWarnings("unchecked")
public class PreviewDataContext extends DataContext {

    @Override
    public Object doExpression(String expression) {
        return expression;
    }

    @Override
    public <T> T doExpression(String expression, Class<T> clazz) {
        if (clazz == String.class) {
            return (T) expression;
        }

        if (clazz == Boolean.class) {
            return (T) Boolean.TRUE;
        }
        return super.doExpression(expression, clazz);
    }
}
